from abc import ABC, abstractmethod

class Block(object):
    def __init__(self, size: int):
        pass

    def size(self):
        pass

    def read(self):
        pass
    def write(self):
        pass

    def get_bytes(self) -> bytes:
        pass

    def get_bytes(self):
        pass
    def get_uint_8(self):
        pass
    def get_uint_16(self):
        pass
    def get_uint_32(self):
        pass
    def get_uint_64(self):
        pass
    def get_int_8(self):
        pass
    def get_int_16(self):
        pass
    def get_int_32(self):
        pass
    def get_int_64(self):
        pass

class BlockDevice(ABC):
    @abstractmethod
    def read(offset: int) -> Block:
        pass

    @abstractmethod
    def write(offset: int, data: Block) -> int:
        pass

class Formatter(ABC):
    @abstractmethod
    def format(self, block: Block):
        return 0
    @abstractmethod
    def check(self, block: Block):
        return False



class Fat12Formatter(Formatter):
    def format(self, block: Block):
        #write sb block
        #write 2 fat blocks
        #write root directory blocks
        return 0

    def check(self, block: Block):
        #read sb block && check it 
        #read 2 fat blocks && check it
        #read root directory blocks && check it 
        return False


def formatter_create(fs_type_name: str) -> Formatter:
    if fs_type_name.lower() == "fat12":
        return Fat12Formatter()
    return Fat12Formatter()

class FileBlockDevice(BlockDevice):
    def __init__(self, path):
        self.__path = path





def make_fs(fs_type_name: str, dev_path: str):
    formater = formatter_create(fs_type_name)
    dev = FileBlock(dev_path)
    return formater.format(dev)


import unittest 
class TestMkfs(unittest.TestCase):
    def test_main(self):
        fs_type_nm = "fat12"
        dev_path = "abc.img"
        self.assertEqual(0, make_fs(fs_type_nm, dev_path))
